package tr.com.netgis.web;

public class LoginResponse {

	private String responseXml;
	private LoginRequest request;
	private Exception exception;
	private String exceptionString;
	
	static class Session {
		private String sessionId;
		
	}
	
	public Session getSession() {
		return session;
	}

	private Session session;
	
	public boolean hasSession (){
		return session != null && session.sessionId != null && !"".equals(session.sessionId);
	}
	
	public String getSessionId (){
		if (session != null)
			return session.sessionId;
		return "";
	}
	
	public LoginResponse(String sessionId) {
		super();
		this.session = new Session();
		this.session.sessionId = sessionId;
	}
	
	public LoginResponse(String responseXml, LoginRequest request) {
		super();
		this.responseXml = responseXml;
		this.request = request;
	}
	
	public LoginResponse(Exception e, LoginRequest request) {
		super();
		this.exception = e;;
		this.request = request;
	}


	public String getResponseXml() {
		return responseXml;
	}

	public void setResponseXml(String responseXml) {
		this.responseXml = responseXml;
	}

	public LoginRequest getRequest() {
		return request;
	}

	public void setRequest(LoginRequest request) {
		this.request = request;
	}

	public Exception getException() {
		return exception;
	}

	public void setException(Exception exception) {
		this.exception = exception;
	}

	public String getExceptionString() {
		return exceptionString;
	}

	public void setExceptionString(String exceptionString) {
		this.exceptionString = exceptionString;
	}

	
	
}
